package com.transitionseverywhere.utils;

import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.ViewGroup;

/* loaded from: classes.dex */
public class ViewOverlayUtils {
    private static final BaseViewOverlayUtils IMPL;

    /* loaded from: classes.dex */
    static class BaseViewOverlayUtils {
        BaseViewOverlayUtils() {
        }

        public void addOverlay(ViewGroup viewGroup, Drawable drawable) {
            ViewOverlayPreJellybean.getOverlay(viewGroup).addDrawable(drawable);
        }

        public void removeOverlay(ViewGroup viewGroup, Drawable drawable) {
            ViewOverlayPreJellybean.getOverlay(viewGroup).removeDrawable(drawable);
        }
    }

    /* loaded from: classes.dex */
    static class JellyBeanMR2ViewUtils extends BaseViewOverlayUtils {
        JellyBeanMR2ViewUtils() {
        }

        @Override // com.transitionseverywhere.utils.ViewOverlayUtils.BaseViewOverlayUtils
        public void addOverlay(ViewGroup viewGroup, Drawable drawable) {
            viewGroup.getOverlay().add(drawable);
        }

        @Override // com.transitionseverywhere.utils.ViewOverlayUtils.BaseViewOverlayUtils
        public void removeOverlay(ViewGroup viewGroup, Drawable drawable) {
            viewGroup.getOverlay().remove(drawable);
        }
    }

    static {
        if (Build.VERSION.SDK_INT >= 18) {
            IMPL = new JellyBeanMR2ViewUtils();
        } else {
            IMPL = new BaseViewOverlayUtils();
        }
    }

    public static void addOverlay(ViewGroup viewGroup, Drawable drawable) {
        IMPL.addOverlay(viewGroup, drawable);
    }

    public static void removeOverlay(ViewGroup viewGroup, Drawable drawable) {
        IMPL.removeOverlay(viewGroup, drawable);
    }
}
